home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Hardware / PC Card SDKs / PC Card Manager 3.0 / CIncludes / DriverFamilyMatching.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-05  |  10.2 KB  |  327 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        DriverFamilyMatching.h
  3.  
  4.      Contains:    xxx put contents here xxx
  5.  
  6.      Version:    xxx put the technology version here xxx
  7.  
  8.      DRI:        Pradeep Kathail
  9.  
  10.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Warning:    *** APPLE INTERNAL USE ONLY ***
  14.                  This file may contain unreleased API's
  15.  
  16.      BuildInfo:    Built by:            SuperMario Build Daemon
  17.                  With Interfacer:    2.0d10   (PowerPC native)
  18.                  From:                DriverFamilyMatching.i
  19.                      Revision:        12
  20.                      Dated:            2/15/96
  21.                      Last change by:    PK
  22.                      Last comment:    Rename Maxwell Descriptor and add function calls to load and
  23.  
  24.      Bugs:        Report bugs to Radar component “System Interfaces”, “Latest”
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. */
  28. #ifndef __DRIVERFAMILYMATCHING__
  29. #define __DRIVERFAMILYMATCHING__
  30.  
  31. #ifndef __TYPES__
  32. #include <Types.h>
  33. #endif
  34. #ifndef __NAMEREGISTRY__
  35. #include <NameRegistry.h>
  36. #endif
  37. #ifndef __TEXTOBJECTS__
  38. #include <TextObjects.h>
  39. #endif
  40. #ifndef __CODEFRAGMENTS__
  41. #include <CodeFragments.h>
  42. #endif
  43.  
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47.  
  48. #if PRAGMA_IMPORT_SUPPORTED
  49. #pragma import on
  50. #endif
  51.  
  52. #if PRAGMA_ALIGN_SUPPORTED
  53. #pragma options align=mac68k
  54. #endif
  55.  
  56. /* Please refer to Devices.i for DriverDescriptor definition for Marconi */
  57. #if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
  58. /*
  59. #########################################################
  60.  Descriptor for Drivers and NDRVs
  61. #########################################################
  62. */
  63. /* Driver Typing Information Used to Match Drivers With Devices */
  64. struct DriverType {
  65.     Str31                             nameInfoStr;                /* Driver Name/Info String*/
  66.     NumVersion                         version;                    /* Driver Version Number*/
  67. };
  68. typedef struct DriverType DriverType;
  69.  
  70. typedef DriverType *DriverTypePtr;
  71. /* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */
  72. typedef OptionBits RuntimeOptions;
  73.  
  74. enum {
  75.     kDriverIsLoadedUponDiscovery = 0x00000001,                    /* auto-load driver when discovered*/
  76.     kDriverIsOpenedUponLoad        = 0x00000002,                    /* auto-open driver when loaded*/
  77.     kDriverIsUnderExpertControl    = 0x00000004,                    /* I/O expert handles loads/opens*/
  78.     kDriverIsConcurrent            = 0x00000008,                    /* supports concurrent requests*/
  79.     kDriverQueuesIOPB            = 0x00000010,                    /* device manager doesn't queue IOPB*/
  80.     kDriverIsLoadedAtBoot        = 0x00000020,                    /* Driver is loaded at the boot time */
  81.     kDriverIsForVirtualDevice    = 0x00000040                    /* Driver is for a virtual Device */
  82. };
  83.  
  84. struct DriverOSRuntime {
  85.     RuntimeOptions                     driverRuntime;                /* Options for OS Runtime*/
  86.     Str31                             driverName;                    /* Driver's name to the OS*/
  87.     UInt32                             driverDescReserved[8];        /* Reserved area*/
  88. };
  89. typedef struct DriverOSRuntime DriverOSRuntime;
  90.  
  91. typedef DriverOSRuntime *DriverOSRuntimePtr;
  92. /* OS Service Information Used To Declare What APIs a Driver Supports */
  93. typedef UInt32 ServiceCount;
  94. struct DriverServiceInfo {
  95.     OSType                             serviceCategory;            /* Service Category Name*/
  96.     OSType                             serviceType;                /* Type within Category*/
  97.     NumVersion                         serviceVersion;                /* Version of service*/
  98. };
  99. typedef struct DriverServiceInfo DriverServiceInfo;
  100.  
  101. typedef DriverServiceInfo *DriverServiceInfoPtr;
  102. struct DriverOSService {
  103.     ServiceCount                     nServices;                    /* Number of Services Supported*/
  104.     DriverServiceInfo                 service[1];                    /* The List of Services (at least one)*/
  105. };
  106. typedef struct DriverOSService DriverOSService;
  107.  
  108. typedef DriverOSService *DriverOSServicePtr;
  109. /* Categories */
  110.  
  111. enum {
  112.     kServiceCategoryDisplay        = 'disp',                        /* Display Manager*/
  113.     kServiceCategoryOpenTransport = 'otan',                        /* Open Transport*/
  114.     kServiceCategoryBlockStorage = 'blok',                        /* Block Storage*/
  115.     kServiceCategoryNdrvDriver    = 'ndrv',                        /* Generic Native Driver*/
  116.     kServiceCategoryScsiSIM        = 'scsi',                        /* SCSI */
  117.     kServiceCategoryFileManager    = 'file',                        /* File Manager */
  118.     kServiceCategoryIDE            = 'ide-',                        /* ide */
  119.     kServiceCategoryADB            = 'adb-',                        /* adb */
  120.     kServiceCategoryPCI            = 'pci-',                        /* pci bus */
  121.                                                                 /* Nu Bus */
  122.     kServiceCategoryPCMCIA        = 'pcmc',                        /* PCMCIA */
  123.     kServiceCategoryDFM            = 'dfm-',                        /* DFM */
  124.     kServiceCategoryMotherBoard    = 'mrbd',                        /* mother Board */
  125.     kServiceCategoryKeyboard    = 'kybd',                        /* Keyboard */
  126.     kServiceCategoryPointing    = 'poit',                        /* Pointing */
  127.     kServiceCategoryRTC            = 'rtc-',                        /* RTC */
  128.     kServiceCategoryNVRAM        = 'nram',                        /* NVRAM */
  129.     kServiceCategorySound        = 'sond',                        /* Sound (1/3/96 MCS) */
  130.     kServiceCategoryPowerMgt    = 'pgmt',                        /* Power Management */
  131.     kServiceCategoryGeneric        = 'genr'                        /* Generic Service Category to receive general Events */
  132. };
  133.  
  134. /* Ndrv ServiceCategory Types */
  135.  
  136. enum {
  137.     kNdrvTypeIsGeneric            = 'genr',                        /* generic*/
  138.     kNdrvTypeIsVideo            = 'vido',                        /* video*/
  139.     kNdrvTypeIsBlockStorage        = 'blok',                        /* block storage*/
  140.     kNdrvTypeIsNetworking        = 'netw',                        /* networking*/
  141.     kNdrvTypeIsSerial            = 'serl',                        /* serial*/
  142.     kNdrvTypeIsSound            = 'sond',                        /* sound*/
  143.     kNdrvTypeIsBusBridge        = 'brdg'
  144. };
  145.  
  146. typedef UInt32 DriverDescVersion;
  147. /*    The Driver Description */
  148.  
  149. enum {
  150.     kInitialDriverDescriptor    = 0,
  151.     kVersionOneDriverDescriptor    = 1
  152. };
  153.  
  154.  
  155. enum {
  156.     kTheDescriptionSignature    = 'mtej',
  157.     kDriverDescriptionSignature    = 'pdes'
  158. };
  159.  
  160. struct DriverDescription {
  161.     OSType                             driverDescSignature;        /* Signature field of this structure*/
  162.     DriverDescVersion                 driverDescVersion;            /* Version of this data structure*/
  163.     DriverType                         driverType;                    /* Type of Driver*/
  164.     DriverOSRuntime                 driverOSRuntimeInfo;        /* OS Runtime Requirements of Driver*/
  165.     DriverOSService                 driverServices;                /* Apple Service API Membership*/
  166. };
  167. typedef struct DriverDescription DriverDescription;
  168.  
  169. typedef DriverDescription *DriverDescriptionPtr;
  170. #endif
  171. #if FOR_SYSTEM8_PREEMPTIVE
  172. /*
  173. ################################################
  174.  Family Matching Data Structure
  175. ################################################
  176. */
  177. /*    The Family Type */
  178.  
  179. enum {
  180.     kFamilyIsHighLevel            = 0,                            /* High Level Family */
  181.     kFamilyIsLowLevel            = 1                                /* Low Level Family  */
  182. };
  183.  
  184. typedef UInt32 FamilyLevel;
  185. /* Family Typing Information Used to Match Families With plug-ins and Devices */
  186. struct FamilyType {
  187.     FamilyLevel                     familyLevel;                /* Kind of Family */
  188.     OSType                             familyName;                    /* Family Name */
  189.     NumVersion                         version;                    /* Family Version Number*/
  190.     OSType                             reserved;                    /* Used by Mother Board Expert */
  191. };
  192. typedef struct FamilyType FamilyType;
  193.  
  194. typedef FamilyType *FamilyTypePtr;
  195.  
  196. enum {
  197.     kFamilyIsLoadedAtBoot        = 0x00000001,                    /* Family is loaded at the boot time */
  198.     kFamilyIsLoadedUponDiscovery = 0x00000002,                    /* auto-load Family when discovered */
  199.     kFamilyIsStartedAtBoot        = 0x00000004                    /* Family is initialized at the Boot */
  200. };
  201.  
  202. typedef UInt32 FamilyOSRunTimeOptions;
  203. struct FamilyOSRunTime {
  204.     FamilyOSRunTimeOptions             familyRuntime;                /* Options for OS Runtime*/
  205.     Str31                             familyName;                    /* Family's name to the OS*/
  206.     UInt32                             familyDescReserved[8];        /* Reserved area*/
  207. };
  208. typedef struct FamilyOSRunTime FamilyOSRunTime;
  209.  
  210. typedef FamilyOSRunTime *FamilyOSRunTimePtr;
  211. /*    The Family Description */
  212.  
  213. enum {
  214.     kFamilyDescriptionSignature    = 'fdes'
  215. };
  216.  
  217. typedef UInt32 FamilyDescVersion;
  218.  
  219. enum {
  220.     kInitialFamilyDescriptor    = 0,
  221.     kMotherBoardDescriptor        = 1
  222. };
  223.  
  224. typedef UInt32 DependencyCount;
  225. struct MatchingAndDependencyInfo {
  226.     union {
  227.         Str31                             deviceName;                /* the device name to match */
  228.         OSType                             dependency;                /* Dependency List */
  229.     }                                 u;
  230. };
  231. typedef struct MatchingAndDependencyInfo MatchingAndDependencyInfo;
  232.  
  233. typedef MatchingAndDependencyInfo *MatchingAndDependencyInfoPtr;
  234. struct FamilyMatchingAndDependency {
  235.     DependencyCount                 nrElements;                    /* Number of elements in the Array */
  236.     MatchingAndDependencyInfo         matchingInfo[1];
  237. };
  238. typedef struct FamilyMatchingAndDependency FamilyMatchingAndDependency;
  239.  
  240. typedef FamilyMatchingAndDependency *FamilyMatchingAndDependencyPtr;
  241. struct FamilyDescription {
  242.     OSType                             familyDescSignature;        /* Signature field of this structure*/
  243.     FamilyDescVersion                 familyDescVersion;            /* Version of this data structure*/
  244.     FamilyType                         familyType;                    /* Type of Driver*/
  245.     FamilyOSRunTime                 familyOSRuntime;            /* OS Runtime Requirements of Family */
  246.     FamilyMatchingAndDependency     familymatchingAndDependency; /* Family Dependency Info */
  247.  
  248. };
  249. typedef struct FamilyDescription FamilyDescription;
  250.  
  251. typedef FamilyDescription *FamilyDescriptionPtr;
  252. /*
  253. ##############################################
  254.  Definition of "driver-ptr" property
  255. ##############################################
  256. */
  257. struct DriverPtrProperty {
  258.     LogicalAddress                     pluginLocator;
  259.     UInt32                             length;
  260. };
  261. typedef struct DriverPtrProperty DriverPtrProperty;
  262.  
  263. typedef DriverPtrProperty *DriverPtrPropertyPtr;
  264. /*
  265. ##############################################
  266.  Status Definition for DFMReportInitStatus
  267. ##############################################
  268. */
  269.  
  270. enum {
  271.     kInitStatusOK                = 0,
  272.     kInitStatusNotOK            = 1
  273. };
  274.  
  275. /*
  276. ##############################################
  277.  Declare the pluginLoadID
  278. ##############################################
  279. */
  280. typedef struct OpaquePluginLoadID* PluginLoadID;
  281. /*
  282. ##############################################
  283.  Function Prototypes
  284. ##############################################
  285. */
  286. extern UInt32 DFMReportInitStatus(OSType serviceCategory, UInt32 status);
  287.  
  288. extern OSStatus DFMRemovePlugIns(RegEntryRef *device, OSType serviceCategory, UInt32 nrPlugIns, LogicalAddress *pluginLocatorsInUse);
  289.  
  290. extern OSStatus DFMLoadPlugin(LogicalAddress pluginLocator, ConstStr63Param pluginName, PluginLoadID *pluginLoadID, LogicalAddress *main, LogicalAddress *pluginDT, TextObject optErrMsg);
  291.  
  292. extern OSStatus DFMUnloadPlugin(PluginLoadID *pluginLoadID);
  293.  
  294. extern OSStatus DFMGetCFragConnectID(PluginLoadID *pluginLoadID, CFragConnectionID *connectionID);
  295.  
  296. /*
  297. ##############################################
  298.  Well known properties in the Name Registry
  299. ##############################################
  300. */
  301.  
  302. #define kPropertyName                    "name"
  303. #define kPropertyCompatible                "compatible"
  304. #define    kPropertyDriverPtr                "driver-ptr"
  305. #define kPropertyDriverDesc                "driver-description"
  306. #define kPropertyReg                    "reg"
  307. #define kPropertyAAPLAddress            "AAPL,address"
  308. #define kPropertyMatching                "matching"
  309.  
  310. /* CPassThru */
  311. #endif
  312.  
  313. #if PRAGMA_ALIGN_SUPPORTED
  314. #pragma options align=reset
  315. #endif
  316.  
  317. #if PRAGMA_IMPORT_SUPPORTED
  318. #pragma import off
  319. #endif
  320.  
  321. #ifdef __cplusplus
  322. }
  323. #endif
  324.  
  325. #endif /* __DRIVERFAMILYMATCHING__ */
  326.  
  327.